package com.company.project.modular.system.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.company.project.modular.system.model.Use;
import com.company.project.modular.system.service.IInstockService;
import com.company.project.modular.system.dao.InstockMapper;
import com.company.project.modular.system.model.Instock;
import com.company.project.modular.system.service.IInstockService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lsf
 * @since 2018-11-08
 */
@Service
public class InstockServiceImpl extends ServiceImpl<InstockMapper, Instock> implements IInstockService {

    /*根据标识码去获取库存表最大的总出入库次数*/
    @Override
    public List<String> findByMaxF(@Param("standCode") String standCode) {
        return this.baseMapper.findByMaxF(standCode);
    }

    @Override
    public List<Instock> selectByAll(@Param("useCode") String useCode) {
        return this.baseMapper.selectByAll(useCode);
    }

    @Override
    public List<String> findByFrequency(@Param("standardCode") String standardCode){
        return this.baseMapper.findByFrequency(standardCode);
    }
    @Override
    public List<String> findByInFrequency(@Param("standardCode") String standardCode){
        return this.baseMapper.findByInFrequency(standardCode);
    }
    @Override
    public List<String> findByOutFrequency(@Param("standardCode") String standardCode){
        return this.baseMapper.findByOutFrequency(standardCode);
    }
    /*根据标识码和总出入库次数去获取库存表剩余量*/
    @Override
    public List<String> findByStandardNumber(@Param("standardCode") String standardCode, @Param("maxTime") String maxTime) {
        return this.baseMapper.findByStandardNumber(standardCode,maxTime);
    }

    /* 根据当前入库次数来查询相应的剩余量*/
    @Override
    public List<String> findByNumber(@Param("standardFrequency") int standardFrequency){
        return this.baseMapper.findByNumber(standardFrequency);
    }

   @Override
    public List<Map<String,Object>> list(@Param("condition") String condition){
       return this.baseMapper.list(condition);
    }
    @Override
    public List<Map<String,Object>> instockNumber0(@Param("condition") String condition){
        return this.baseMapper.instockNumber0(condition);
    }
}
